package router

import (
	"github.com/gin-gonic/gin"
	"radar-app/app/api"
)

func InitRouter() *gin.Engine {
	r := gin.New()
	r.Use(gin.Logger())
	r.Use(gin.Recovery())

	apiV1 := r.Group("/v1/app")

	userGroup := apiV1.Group("/user")
	{
		userGroup.GET("/list", api.UserCtl.List)
		userGroup.POST("/add", api.UserCtl.Add)
		userGroup.PUT("/update", api.UserCtl.Update)
		userGroup.DELETE("/delete", api.UserCtl.Delete)
	}

	return r
}
